import request from '@/utils/myrequest'

export function getList(kvs) {
  return request({
    url: 'config/database/getlist',
    method: 'get',
    kvs
  })
}

export function getOperationList() {
  return request({
    url: 'config/database/GetOperationList',
    method: 'get'
  })
}

export function add(kvs) {
  return request({
    url: 'config/database/Add',
    method: 'post',
    kvs
  })
}

export function edit(kvs) {
  return request({
    url: 'config/database/Update',
    method: 'post',
    kvs
  })
}

export function get(kvs) {
  return request({
    url: 'config/database/Get',
    method: 'get',
    kvs
  })
}

export function del(kvs) {
  return request({
    url: 'config/database/delete',
    method: 'post',
    kvs
  })
}

export function execute(kvs) {
  var module = kvs.module
  return request({
    url: module + '/database/execute?id=' + kvs.id,
    method: 'get'
  })
}

export default { getList, getOperationList, add, edit, get, del, execute }
